/*!*********************************************************************************
 * X2Engine Open Source Edition is a customer relationship management program developed by
 * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
 * California 94061, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2 Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2 Engine".
 **********************************************************************************/




.chart-container {
    border: none !important;
    padding-bottom: 0px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    overflow: hidden !important;
    .chart {
        width: 98%;
        height: 200px;
        text-align: center;
        margin: 0 auto;
    }


    .date-range-selector {
        transition: opacity .2s;    
        border-top-left-radius: 0px;
        border-bottom-left-radius: 0px;
        margin-left: -5px !important;


    }

    .date-range-type-selector {
        transition: border-radius 0.5s;
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
        margin-right: 0px !important;
        &.rounded {
            border-radius: 3px;
        }  
    }

}

/* Pie chart data labels */

.jqplot-pie-series.jqplot-data-label {
    color: #ffffff;
}

/*
Pie chart overrides
*/

.chart-container {
    .chart.pie {
        height: 235px !important;
        /*margin-top: 28px;*/
    }
    .chart-legend.pie {
        margin-top: -15px;
        /*position: relative;
        top: 5px;*/
    }
    .bin-size-button-set.pie {
        display: none;
    }
    .datepicker-row {
        &.pie {
            /*float: right;
            clear: none;*/
        }
        &.action-history-pie {
            /*float: right;
            clear: none;
            position: relative;
            z-index: 100;*/
        }
    }
    .rel-chart-data-checkbox-container.pie {
        /*clear: both;*/
    }
    .top-button-row {
        &.pie {
            /*float: left;
            clear: none;*/
            display: none;
        }
        &.feed-pie {
            /*float: left;
            clear: none;*/
        }
    }
    .create-setting-button.pie {
        /*clear: both;
        position: relative;
        z-index: 100;*/
    }
    .ui-multiselect.pie {
        display: none;
    }
    .predefined-settings.pie {
        position: relative;
        z-index: 100;
    }
    .rel-chart-data-checkbox-container {
        margin-top: 4px;
        height: 20px;
        > {
            input {
                margin: 0 0 0 3px;
            }
            label {
                margin: 0 0 0 0;
            }
        }
    }
}

/*
Related records' data option
*/

/*
Chart setting dialog
*/

.chart-setting-name-input-container {
    margin-top: 9px !important;
    margin-bottom: 0px !important;
}

.create-chart-setting-dialog input {
    margin-top: 0px !important;
}

.chart-setting-name {
    width: 170px !important;
    margin-left: 4px !important;
    margin-bottom: 4px !important;
}

/*
Chart legend
*/

.chart-legend {
    padding-top: 7px;
    padding-left: 15px;
    table-layout: fixed;
    width: 80%;
    border-spacing: 4px;
    .chart-color-label {
        font-size: 12px;
        color: #505050;
    }
    .chart-color-swatch {
        width: 10px;
        height: 10px;
        margin-right: 4px;
        float: left;
        -moz-border-radius: 5px;
        -o-border-radius: 5px;
        -webkit-border-radius: 5px;
        border-radius: 5px;
        margin-top: 2px;
    }
}

/*
data point tooltip
*/

.chart-tooltip {
    padding: 4px;
    min-width: 100px;
    background: white;
    border: 1px solid #ccc;
    .chart-tooltip-date {
        font-weight: bold;
        color: .424242;
    }
}

/*
Chart settings
*/

.chart-container {
    .delete-setting-button {
        margin-top: 6px;
        margin-left: -2px;
        margin-right: 11px;
    }
    .create-setting-button {
        margin-bottom: 0;
        margin-top: 2px;
    }
    .predefined-settings {
        width: 100px;
        margin-top: 4px;
        margin-right: 4px;
    }
    .bin-size-button-set {
        margin-top: 1px;
    }
    a {
        text-decoration: none;
    }
    button.selected {
        border: 1px solid black;
    }
    a.x2-button {
        margin: 0px -4px 0 0;
    }
    .datepicker-row {
        margin-top: -0px;
        button {
            margin-right: 0;
        }
    }
    .chart-filters-container {
        height: 30px;
        display: block;
        button.ui-multiselect {
            margin-right: 5px;
            margin-bottom: 2px;
        }
    }
    button {
        &.show-chart-filters-button, &.hide-chart-filters-button {
            margin: 1px 0 0 5px;
        }
        &.ui-multiselect {
            float: left;
            margin-top: 2px;
        }
        &.x2-small-button {
            font-size: 80%;
        }
    }
    .datepicker-row, .top-button-row {
        /*position: relative;
        z-index: 100;*/
    }
    .chart-datepicker-to, .chart-datepicker-from {
        width: 100px;
    }
}

/*
bin size selection buttons
*/

/*
date pickers
*/

/*
advanced settings
*/

.pie-chart-count-container {
    display: inline;
    margin-left: 67%;
    bottom: 50px;
    background: #E6E6E6;
    padding: 3px 4px;
    position: relative;
}

/* ie8 fixes */

.x2-chart-multiselect {
    max-width: 225px;
    width: 30%;
    min-width: 150px;
}

@media (max-width: 543px) {
    .chart-legend {
        width: 100%;
    }
}

@media (max-width: 470px) {
    #actionHistoryChart-bin-size-button-set {
        margin: auto;
        left: 0;
        right: 0;
        position: absolute;
        text-align: center;
    }
    body.show-left-bar #actionHistoryChart-bin-size-button-set {
        left: 161px;
        width: 300px;
    }
    .x2-chart-multiselect {
        margin-top: 33px !important;
    }
}
